
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>append</title>
</head>

<body>
<h2>title</h2>
<ul>
    <li class="item1">新闻标题-1</li>
    <li class="item2">新闻标题-2</li>
    <li class="item3">新闻标题-3</li>
    <li class="item4">新闻标题-4</li>
    <li class="item5">新闻标题-5</li>
    <li class="item6">新闻标题-6</li>
    <li class="item7">新闻标题-7</li>
    <li class="item8">新闻标题-8</li>
    <li class="item9">新闻标题-9</li>
</ul>
<script src="../vendor/jquery-1.12.4.js"></script>
<script>
    $(function() {

                var elements = $('li');
                //插入代码
                elements.append('&nbsp;&nbsp;<a href="#">阅读更多</a>')

                var element = $('ul');

                  element.append('<li>append</li>')   //同级
                  element.prepend('<li>prepend</li>')  //同级
                  element.after('<li>after</li>')    //父级
                  element.before('<li>before</li>')  //父级

                  element.append($('h2'))
        //        element.append($('.item1'))
        //        element.append('<p>p1</p>', ['<p>p2</p>', $('h2')], $('.item1'))
        $('h2').appendTo(element);
    });
</script>
</body>

</html>
